<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>用户登录</title>
	<link rel="stylesheet" type="text/css" href="skin/default/css/login.css">
	<link type="text/css" href="skin/default/css/index.css" rel="stylesheet" />
	<script type="text/javascript" src="js/verify.js"></script>
	<%String username = (String)session.getAttribute("username"); %>
  </head>
  <body>
  <div id="container">
  <jsp:include page="head.jsp"></jsp:include>
	 <span style="color: red;"> *此界面没有美化，以后会改用AJAX来做，现在也就是把基本功能实现</span>
  	<div id="login">
  	<%if(username==null){ %>
 	 <form action="LoginServlet" method="post" name="login">
	 	<div>用户名：<input type="text" name="username" id="username"></div>
	 	<div>密  码：<input type="password" name="password" id="password"></div>
	 	<input type="button" value="提交" onclick="loginCheck()"><input type="reset" value="重置">
  	</form>
  	<%}else{ %>
  	<div>您已经登录，不需要再登录！<a href="javascript:history.back()">返回</a></div>
  	<%} %>
  	<div>
	  	<%String result = (String)request.getAttribute("error"); 
	  		if("PWD".equals(result)) out.println("密码错误！");
	  		if("NOUSER".equals(result)) out.println("没有此用户");
	  	%>
  	</div>
  	</div>
  	<jsp:include page="foot.jsp"></jsp:include>
  </div>
  </body>
</html>
